package com.group.controller;

import com.group.service.AnorderService;
import com.group.user.ChaVo;
import com.group.user.ClientVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController
public class AnorderController {

    @Autowired
    private AnorderService anorderService;

    @GetMapping("list")
    public List list(){
        return anorderService.list();
    }

    @PostMapping("memberlist")
    public List memberlist(@RequestBody ChaVo chaVo){
        return anorderService.memberlist(chaVo);
    }

    @DeleteMapping("memberdel")
    public void memberdel(@RequestParam int id){
        anorderService.memberdel(id);
    }

    @PostMapping("memberadd")
    public void memberadd(@RequestBody ClientVo clientVo){
        anorderService.memberadd(clientVo);
    }

    @GetMapping("memberto")
    public ClientVo memberto(@RequestParam int id){
        return anorderService.memberto(id);
    }

    @GetMapping("memberpass")
    public ClientVo memberpass(@RequestParam int id){
        return anorderService.memberpass(id);
    }

    @GetMapping("memberstatus")
    public void memberstatus(@RequestParam int id,@RequestParam int status){
        anorderService.memberstatus(id,status);
    }

    @GetMapping("delAll")
    public void delAll(@RequestParam String ids){
        anorderService.delAll(ids);
    }
}
